﻿Imports SS
Imports SS.Databases
Imports SS.Databases.Connecter
Imports SS.ApplicationBlock

Public Class PostCode

	Public Shared Function AllPostCode(ByVal provinceId As String, ByVal districtId As String) As List(Of Entity.PostCodeItem)

		Using connOraSelect As New DBOracle(Common.Utility.ConnectString, False)
			Dim dt As DataTable = connOraSelect.GetDataTable("Select DISTINCT POSTCODE from " & Common.Utility.Schema & ".RNW_VW_POSTCODE Where PROVINCE_ID ='" & provinceId & "' And DISTRICT_ID = '" & districtId & "'", "District")
			If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
				Dim objReturn As List(Of Entity.PostCodeItem)
				objReturn = New List(Of Entity.PostCodeItem)
				objReturn = SS.ORM.Broker.RetrieveInstance(Of Entity.PostCodeItem)(dt)
				Return objReturn
			Else
				Return Nothing
			End If
		End Using

	End Function

End Class
